<template>
  <div class="register-container">
    <div class="register-content">
      <div class="register-left">
        <div class="logo-container">
          <router-link to="/">
            <img src="/logo.png" alt="LOGO" class="logo">
          </router-link>
        </div>
        <div class="register-box">
          <h2 class="register-title">会员注册</h2>
          <el-form>
            <el-form-item>
              <el-input placeholder="电子邮件">
                <template #prefix>
                  <el-icon>
                    <Message />
                  </el-icon>
                </template>
              </el-input>
            </el-form-item>
            <el-form-item>
              <el-input type="password" placeholder="密码">
                <template #prefix>
                  <el-icon>
                    <Lock />
                  </el-icon>
                </template>
              </el-input>
            </el-form-item>
            <el-form-item>
              <el-input type="password" placeholder="确认密码">
                <template #prefix>
                  <el-icon>
                    <Lock />
                  </el-icon>
                </template>
              </el-input>
            </el-form-item>
            <el-form-item>
              <el-button type="primary" class="register-button" style="width: 100%;">立即注册</el-button>
            </el-form-item>
            <div class="register-options">
              <el-checkbox>我已阅读并同意<a href="#" class="terms-link">服务条款</a></el-checkbox>
              <router-link to="/login" class="login-link">已有账号？立即登录</router-link>
            </div>
          </el-form>
        </div>
      </div>
      <div class="register-right">
        <div class="register-images">
          <img src="/reg/join_us.png" alt="加入我们" class="register-image join-us-image">
          <div class="japanese-text">さあ、クラウドワークスをはじめよう。</div>
          <img src="/reg/regimg.png" alt="注册页面图片" class="register-image">

        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { Message, Lock } from '@element-plus/icons-vue'
</script>

<style scoped>
.register-container {
  width: 100%;
  min-height: 93vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #e7f1fa;
  padding: 20px;
}

.register-content {
  display: flex;
  width: 100%;
  max-width: 1000px;

  border-radius: 8px;
  /* box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1); */
  overflow: hidden;
}

.register-left {
  flex: 1;
  /* padding: 30px; */
  display: flex;
  flex-direction: column;
  background-color: transparent;

}

.register-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
}

.register-images {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  background-color: transparent;
}

.register-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  margin-top: 20px;
}

.join-us-image {
  object-fit: contain;
  height: 50px;
  margin-bottom: 20px;
}

.register-box {
  width: 100%;
  max-width: 350px;
  margin: 0 auto;
  background-color: white;
  padding: 30px;
  border-radius: 8px;
}

.logo-container {
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
}

.logo-container a {
  display: inline-block;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.logo-container a:hover {
  transform: scale(1.05);
}

.logo {
  height: 60px;
  object-fit: contain;
}

.register-title {
  text-align: center;
  margin-bottom: 30px;
  color: #333;
}

.register-button {
  background-color: var(--el-color-primary);
  border-color: var(--el-color-primary);
  height: 40px;
}

.register-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 15px;
  flex-wrap: wrap;
}

.login-link {
  color: var(--el-color-primary);
  text-decoration: none;
  margin-left: auto;
  margin-top: 15px;
}

.terms-link {
  color: var(--el-color-primary);
  text-decoration: none;
}

/* 响应式布局 */
@media (max-width: 768px) {
  .register-content {
    flex-direction: column;
  }

  .register-right {
    display: none;
    /* 在小屏幕上隐藏图片 */
  }

  .register-left {
    width: 100%;
  }
}

/* 日文文本样式 */
.japanese-text {
  font-size: 1.2rem;
  font-weight: 500;
  color: #333;
  margin: 15px 0;
  text-align: center;
  width: 100%;
  font-family: 'Noto Sans JP', sans-serif;
  letter-spacing: 0.05em;
  line-height: 1.5;
}

/* 中等屏幕响应式布局 */
@media (min-width: 769px) and (max-width: 1024px) {
  .register-images {
    flex-direction: column;
  }

  .register-image {
    max-width: 90%;
    margin-bottom: 15px;
  }

  .join-us-image {
    margin-left: 0;
    margin-top: 15px;
  }
}
</style>